<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<!-- 
Author: Tyler Mazaika
Class: COIN 71 
Filename: templateTransitional.html 
Date Created: 3/12/09

--> 
 
<head> 
 <title>PABC - Newsletters</title> 
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
 
 <script type="text/javascript" language="javascript" src="jquery/jquery-1.3.2.js"></script>
 <script type="text/javascript" src="_javascripts/ContentLoader.js" ></script>	
 
 <link rel="stylesheet" type="text/css" href="_stylesheets/pabc.css" />
     <link rel="stylesheet" type="text/css" href="datepicker/jquery.datepick.css" />

<!-- function for generating 2-column table based on contents of "newsletters" folder 
Added by: Tyler
3/12/08

Based on code supplied to php.net by ianatvirante.com 
http://us3.php.net/manual/en/function.readdir.php
-->
<?php
    
    // This function walks through directory specified by "$dir_handle" and creates a table 
    // with downloadable files and upload dates for all files in the directory.
    // "$path" is download path for each file.
    function list_dir($dir_handle,$path)
    {    
        echo "<table><tr><th>Newsletter</th><th>Upload Date</th></tr>";
        
        //running the while loop
        while (false !== ($file = readdir($dir_handle))) {
            $dir =$path.'/'.$file;
            
            $lastModTime = date("n\-j\-y", filectime("$path$file")); //get the date the file was uploaded
            
            if($file != '.' && $file !='..' && !is_dir($file))            // updated by Archana, 3.17.09 
            {
                 echo "<tr><td><a href='ftp:".$path.$file."' target='_blank'>".$file."</a></td><td>".$lastModTime."</td></tr>";
            }
        }
       
        echo "</table>";
    
        //closing the directory
        closedir($dir_handle);
       
    }
?> 

</head> 
<body> 


    <!-- HEADER -->
        <?php include("header.php") ?>
    <!-- end HEADER -->
    
    
    
    <!-- WRAPPER -->
    <div id="wrapper">
    
        <!-- LEFT COL -->
        <div class="leftcol">
            <?php include("leftcol.php") ?>
        </div>
        <!-- END LEFT COL -->
    
    
        
        <!-- RIGHT COL -->
        <div class="rightcol">
        
        
            <!-- ********* MAIN PAGE CONTENT *********** -->
            <div id="newsletter_archive">
            <h3>Newsletter Archive</h3>
            
            <!-- generates 2-column table for archived newsletters -->
            <?php
                 //define the path as relative
                $path = "newsletters/";
                
                //using the opendir function
                $dir_handle = @opendir($path) or die("Unable to open $path");
                
                list_dir($dir_handle,$path);
            ?>
                    
            </div>
            <!-- ********* END MAIN CONTENT ************ -->
            
            
        </div>
        <!-- END RIGHT COLUMN -->
    
    
    </div>
    <!-- end WRAPPER -->
    
    
    <!-- FOOTER -->
        <?php include("footer.php") ?>
    <!-- END FOOTER -->


</body> 
 
</html> 